def triangle2(n):
    print("---------------上三角---------------")
    for i in range(1,n+1):
        list1 = []
        list1.append('\t'*(n-i))
        while i > 0:
            list1.append(i)
            i -= 1
        for each in list1:
            print(each,end ='\t')
        print()
    print("---------------下三角---------------")

    for i in range(1,n+1): #i =1 range(1,13)
        list2 = []
        list2.append('\t'*(i-1))         
        list_num = list(range(1,n+1))[::-1]
        n -=1
        new_list = list2 + list_num
        for each in new_list:
            print(each,end = "\t")
        print()

# 完成的不错，不过空隙有点大
